# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification do
  @moduledoc """
  Private password leak verification info.

  ## Attributes

  *   `encryptedLeakMatchPrefixes` (*type:* `list(String.t)`, *default:* `nil`) - Output only. List of prefixes of the encrypted potential password leaks that matched the given parameters. They must be compared with the client-side decryption prefix of `reencrypted_user_credentials_hash`
  *   `encryptedUserCredentialsHash` (*type:* `String.t`, *default:* `nil`) - Optional. Encrypted Scrypt hash of the canonicalized username+password. It is re-encrypted by the server and returned through `reencrypted_user_credentials_hash`.
  *   `lookupHashPrefix` (*type:* `String.t`, *default:* `nil`) - Required. Exactly 26-bit prefix of the SHA-256 hash of the canonicalized username. It is used to look up password leaks associated with that hash prefix.
  *   `reencryptedUserCredentialsHash` (*type:* `String.t`, *default:* `nil`) - Output only. Corresponds to the re-encryption of the `encrypted_user_credentials_hash` field. It is used to match potential password leaks within `encrypted_leak_match_prefixes`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :encryptedLeakMatchPrefixes => list(String.t()) | nil,
          :encryptedUserCredentialsHash => String.t() | nil,
          :lookupHashPrefix => String.t() | nil,
          :reencryptedUserCredentialsHash => String.t() | nil
        }

  field(:encryptedLeakMatchPrefixes, type: :list)
  field(:encryptedUserCredentialsHash)
  field(:lookupHashPrefix)
  field(:reencryptedUserCredentialsHash)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification do
  def decode(value, options) do
    GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1PrivatePasswordLeakVerification do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
